package licslan.hwl.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import licslan.hwl.dubbo.service.DemoServiceXXX;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/index")
public class TestController {

    @Reference(version = "1.0.0")
    private DemoServiceXXX demoService;

    /*@Autowired
    RedisConnectionFactory  factory;*/

    @RequestMapping("/getList")
    public String getList(){
        System.out.println("----------------");
        return JSON.toJSONString(demoService.selectList());
    }


    /**
     * 测试连接redis
     * */
    /*@RequestMapping("/redisTest")
    public void redisTest() {
        RedisConnection conn = factory.getConnection();
        conn.set("hello".getBytes(), "world".getBytes());
        System.out.println(new String(conn.get("hello".getBytes())));
    }*/




}
